
package jweslley.ContestVolumes.VolumeC;

import java.util.Scanner;

/**
 * http://icpcres.ecs.baylor.edu/onlinejudge/external/100/10010.html
 *
 * @author  Jonhnny Weslley
 * @version 1.00, 19/10/2008
 */
public class WhereIsWaldorf {

	public static void main(String[] args) {
		StringBuilder out = new StringBuilder();
		Scanner in = new Scanner(System.in);
		int n, result;
		while (in.hasNext()) {
			n = in.nextInt();
			if (n == 0) {
				break;
			}
			result = 0;
			for (int i = 1; i < n; i++)
				for (int j = i + 1; j <= n; j++) {
					result += gcd(i, j);
				}
			out
			.append(result)
			.append('\n');
		}
		System.out.print(out);
	}

	private static int gcd(int i, int j) {
		return 0;
	}

}
